package com.cloudys.controller;

import com.cloudys.bean.TestUser;
import com.cloudys.service.TestInterface;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class TestController {


    //增加日志
    private final Logger log = LoggerFactory.getLogger(TestController.class);

    @Autowired
    private TestInterface testInterFace;

    @RequestMapping("/num")
    @ResponseBody
    int home() {
        int i = testInterFace.testInterFace();
        return i;
    }
    @RequestMapping("/get")
    @ResponseBody
    TestUser getUser() {
        //打印日志
        log.info("TestController getUser info");
        return testInterFace.testUser();
    }

}
